package com.xxx.video.dynamic.adapters;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.xxx.video.R;
import com.xxx.video.commen.adapters.BaseRecycleViewAdapter;
import com.xxx.video.commen.adapters.BaseViewHolder;

import butterknife.BindView;
import butterknife.OnClick;

public class MyFriendListTopAdapter extends BaseRecycleViewAdapter<Object, MyFriendListTopAdapter.MyHolder> {



    public MyFriendListTopAdapter(@NonNull Context context) {
        super(context);
    }

    @Override
    public MyHolder onCreateDefaultViewHolder(View view, int viewType) {
        return new MyHolder(view);
    }

    @Override
    public boolean isSetBaseItemViewClickListener() {
        return false;
    }

    @Override
    public int getItemLayout(int viewType) {
        return R.layout.item_my_friend_list_top;
    }

    @Override
    public int getItemCount() {
        return 1;
    }


    class MyHolder extends BaseViewHolder {
        @BindView(R.id.tv_item_my_friend_list_top_contacts_add_friends)
        TextView tvItemMyFriendListTopContactsAddFriends;
        @BindView(R.id.tv_item_my_friend_list_top_send_my_friend_request)
        TextView tvItemMyFriendListTopSendMyFriendRequest;
        @BindView(R.id.tv_item_my_friend_list_top_get_my_friend_request)
        TextView tvItemMyFriendListTopGetMyFriendRequest;
        @BindView(R.id.tv_item_my_friend_list_top_find_friend)
        TextView tvItemMyFriendListTopFindFriend;

        public MyHolder(View itemView) {
            super(itemView);
        }

        @Override
        public void setData2View(int position) {
        }

        @OnClick({R.id.tv_item_my_friend_list_top_contacts_add_friends,
                R.id.tv_item_my_friend_list_top_send_my_friend_request,
                R.id.tv_item_my_friend_list_top_find_friend,
                R.id.tv_item_my_friend_list_top_get_my_friend_request})
        public void onViewClicked(View view) {
            switch (view.getId()) {
                case R.id.tv_item_my_friend_list_top_contacts_add_friends:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 1);
                    }
                    break;

                case R.id.tv_item_my_friend_list_top_send_my_friend_request:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 2);
                    }
                    break;
                case R.id.tv_item_my_friend_list_top_find_friend:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 4);
                    }
                    break;
                case R.id.tv_item_my_friend_list_top_get_my_friend_request:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 3);
                    }
                    break;
                default:
                    break;
            }
        }
    }
}
